package com.lfy.kcat.content.job;

import com.lfy.kcat.content.biz.TencentVodService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @author leifengyang
 * @version 1.0
 * @date 2025/9/15 15:21
 * @description:
 */
@Service
public class TranslatorJob {


    @Autowired
    TencentVodService tencentVodService;

    @XxlJob("vodInfoFlowTransalator")
    public void vodInfoFlowTransalator() {
        String jobParam = XxlJobHelper.getJobParam();
        //短剧id是任务执行的时候传递
        XxlJobHelper.log("开始信息流转码：短剧id：" + jobParam);
        if (StringUtils.hasText(jobParam)){
            long l = Long.parseLong(jobParam);
            tencentVodService.vodInfoFlowTransalator(l);
        }

    }

    @XxlJob("vodQualityTransalator")
    public void vodQualityTransalator() {
        String jobParam = XxlJobHelper.getJobParam();
        //短剧id是任务执行的时候传递
        XxlJobHelper.log("开始画质转码：短剧id：" + jobParam);
        if (StringUtils.hasText(jobParam)){
            long l = Long.parseLong(jobParam);
            tencentVodService.vodQualityTransalator(l);
        }

    }
}
